//
//  FiestGenCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/7/10.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "FiestGenCell.h"

#import "MJGenModel.h"
#define CELL_WID self.frame.size.width
@implementation FiestGenCell




-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        
        _yuanImg = [[UIImageView alloc] init];
        _yuanImg.backgroundColor = [UIColor redColor];
        _yuanImg.image = [UIImage imageNamed:@"Gen_yuan"];
        [self addSubview:_yuanImg];
        [_yuanImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(5, 5));
            make.left.equalTo(self.mas_left).offset(15);
            make.top.equalTo(self.mas_top).offset(10);
        }];
        
        _nianLab = [[UILabel alloc] init];
        _nianLab.textColor = [UIColor orangeColor];
        _nianLab.font = [UIFont systemFontOfSize:12];
        _nianLab.text = @"2017/07/07";
        [self addSubview:_nianLab];
        [_nianLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(100, 15));
           make.left.equalTo(_yuanImg.mas_right).offset(8);
             make.top.equalTo(self.mas_top).offset(8);
        }];
        
//        _timeLab = [[UILabel alloc] init];
//        _timeLab.textColor = [UIColor blackColor];
//        _timeLab.font = [UIFont systemFontOfSize:10];
//        _timeLab.text = @"10:30";
//        [self addSubview:_timeLab];
//        [_timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.size.mas_equalTo(CGSizeMake(100, 18));
//            make.left.equalTo(self.mas_left).offset(30);
//            make.top.equalTo(_nianLab.mas_bottom).offset(5);
//        }];
//        float hourHight = 18.0f;
        
        
    
//
//        _conLab = [[UILabel alloc] init];
//        _conLab.textColor = [UIColor blackColor];
//        _conLab.font = [UIFont systemFontOfSize:10];
//        _conLab.numberOfLines = 0;
//        NSString *str = @"首先，我们要明确一点，同步和异步都是在线程中使用的。在iOS开发中，比如网络请求数据时，若使用同步请求，则只有请求成功或者请求失败得到响应返回后";
//        _conLab.text = str;
//        NSInteger wid = CELL_WID;
//        [self addSubview:_conLab];
//        [_conLab mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.width.mas_equalTo(wid);
//            make.left.equalTo(self.mas_left).offset(30);
//            make.top.equalTo(_timeLab.mas_bottom).offset(5);
//            make.right.equalTo(self.mas_right).offset(-30);
//        }];
//        CGRect conSize = [str boundingRectWithSize:CGSizeMake(CELL_WID - 30*2, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10]} context:nil];
//
//        float conHeight = conSize.size.height;
 
//
//        _lineLab = [[UILabel alloc] init];
//        _lineLab.backgroundColor = [UIColor orangeColor];
//        _lineLab.numberOfLines = 0;
//        [self addSubview:_lineLab];
//        [_lineLab mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.width.mas_equalTo(1.0f);
//            make.centerX.equalTo(_yuanImg.mas_centerX);
//            make.top.equalTo(_yuanImg.mas_bottom).offset(2);
//            make.bottom.mas_equalTo(_conLab.mas_bottom).offset(8);
//        }];
//        
//        for (int i=0; i<3; i++)
//        {
//            _timeLab = [[UILabel alloc] init];
//            _timeLab.textColor = [UIColor blackColor];
//            _timeLab.font = [UIFont systemFontOfSize:10];
//            _timeLab.text = @"10:30";
//            _timeLab.frame =CGRectMake(30, 45+, <#CGFloat width#>, <#CGFloat height#>)
//            [self addSubview:_timeLab];
//         
//        }
//        
//        for (int A = 0; A<3; A++)
//        {
//            _conLab = [[UILabel alloc] init];
//            _conLab.backgroundColor = [UIColor redColor];
//            _conLab.textColor = [UIColor blackColor];
//            _conLab.font = [UIFont systemFontOfSize:10];
//            _conLab.numberOfLines = 0;
//            NSString *str = @"首先，我们要明确一点，同步和异步都是在线程中使用的。在iOS开发中，比如网络请求数据时，若使用同步请求，则只有请求成功或者请求失败得到响应返回后";
//            _conLab.text = str;
//            _conLab.frame = CGRectMake(30, CGRectGetMaxY(_timeLab.frame)+10, CELL_WID-30*2, 0);
//            [self addSubview:_conLab];
//     
//
//        }
//        
        
        
    }
    return self;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
